<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"
      layout:decorate="~{admin/layout}">
<body>
<div class="content-wrap" layout:fragment="content">
    <main id="content" class="content" role="main">
        <ol class="breadcrumb">
            <li>我要搜索</li>
            <li class="active"><a th:href="@{/admin/landMass/remarks/seek}">备注搜索</a></li>
        </ol>
        <div class="row">
            <div style="width: 50%;">
                <input  id="search-input" placeholder="备注">
                <button onclick="selectLandMass()" class="btn btn-secondary">搜索</button>
            </div>
            <script>
                function selectLandMass() {
                    if($("#search-input").val()==null){
                        alert("请输入地块编号");
                    }
                    if(($("#search-input").val()!=null)){
                        self.location.href = "/admin/landMass/remarks/seek?remarks="+$("#search-input").val();
                    }
                }
            </script>
        </div>
        <div role="tabpanel" class="tab-pane clearfix active" id="basic" aria-labelledby="basic-tab" aria-expanded="true">
            <div class="mt">
                <table id="datatable-table"  class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th>位置</th>
                        <th>备注</th>
                        <th>修改</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="landMasses:${landMasses}">
                        <td th:text="${landMasses.serialNumber}"></td>
                        <td th:text="${landMasses.remarks}"></td>
                        <td>
                            <span th:value="${landMasses.landMass_id}" data-toggle="modal"  data-target="#myModal18"  class="glyphicon glyphicon-pencil update"></span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <script>
            $(".update").click(function () {
                $("#landMass_id").val($(this).attr("value"));
            });
        </script>
        <div class="modal fade" id="myModal18" tabindex="-1" role="dialog" aria-labelledby="myModalLabel18" aria-hidden="true" style="display: none;">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h5 class="modal-title text-xl-center fw-bold mt" id="myModalLabel18">死亡率设定</h5>
                    </div>
                    <div class="modal-body bg-gray-lighter">
                        <form th:action="@{/admin/landMass/remarke/update}" enctype="multipart/form-data" id="validation-form" class="form-horizontal form-label-left" method="post">
                            <input type="hidden" name="landMass_id" id="landMass_id">
                            <fieldset>
                                <div class="form-group row">
                                    <label class="control-label col-sm-3" >
                                        备注：
                                    </label>
                                    <div class="col-sm-9">
                                        <input type="text" name="remarks" class="form-control" required="required">
                                    </div>
                                    <div class="col-sm-9">
                                        <button type="submit" id="sub" class="btn btn-danger btn-rounded">提交</button>
                                    </div>
                                </div>
                            </fieldset>
                        </form>
                    </div>
                </div>
            </div>
        </div>

    </main>
</div>
</body>
</html>